package com.qbw.app.module.vehicle.holder;

import android.content.Context;
import android.view.ViewGroup;

import com.qbw.app.R;
import com.qbw.app.databinding.VehicleHolderElectricareaItemBinding;
import com.qbw.app.model.ElectricArea;
import com.qbw.app.module.common.holder.CommonHolder;
import com.qbw.app.module.vehicle.activity.VehicleAddElectricAreaActivity;

/**
 * @author QBW
 * @date 2019/9/26
 */
public class VehicleElectricAreaItemHolder extends CommonHolder<ElectricArea, VehicleHolderElectricareaItemBinding> {

    public VehicleElectricAreaItemHolder(Context context, ViewGroup viewParent) {
        super(context, R.layout.vehicle_holder_electricarea_item, viewParent);
    }

    @Override
    public void bindData(int position, ElectricArea data) {
        super.bindData(position, data);
        mBinding.setElec(data);
        mBinding.executePendingBindings();
        itemView.setOnClickListener(mClickListenerItem);
    }

    @Override
    protected void onClickItem() {
        VehicleAddElectricAreaActivity.start(mContext, mData);
    }
}
